package cn.wolfcode.shop.alipay;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AlipayConfig {

    @Bean
    public AlipayClient alipayCient(AlipayProperties properties){
        AlipayClient alipayClient = new DefaultAlipayClient(properties.getGatewayUrl(), properties.getAppId(), properties.getMerchantPrivateKey(), "json", properties.getCharset(), properties.getAlipayPublicKey(), properties.getSignType());
        return alipayClient;
    }
}
